package doubanhongniang

import java.io.IOException;

import com.google.gdata.client.douban.DoubanService;
import com.google.gdata.data.douban.UserEntry;
import com.google.gdata.data.douban.UserFeed;
import com.google.gdata.util.ServiceException;

class DoubanAccessService {

    static transactional = true
    static String apiKey = "059ef56f6b705e1210dce04e42511a36";
	static String secret = "006ba4a489916c13";

	static DoubanService doubanService = new DoubanService("subApplication", apiKey,secret);

    def getAuthorizationUrl(String callbackUrl) {
    	doubanService.getAuthorizationUrl(callbackUrl)
    }
    
    def getAuthorizedUser(accessToken, secret) {
    	doubanService.setAccessToken(accessToken, secret);
    	doubanService.getAuthorizedUser()
    }
    
    def getUserEntry(userName) {
		UserEntry userEntry;
		doubanService.getUser(userName);
    }
}
